﻿@using LaxCraft.Repositories;
@using LaxCraft.Domain;
@using LaxCraft.Helpers;
@{
    ViewBag.Title = "Team Roster";
}
<h2>LZ White</h2>
<table id="teamTable" class="tablesorter">
<thead>
    <tr>
        <th>
            Name
        </th>
        @foreach (var stat in ViewBag.Stats) {
            <th>
                <span class="abbreviation">@stat.Abreviation</span>
                <div class="tooltip">
                    @stat.Name - @stat.Description
                </div>
            </th>
        }
    </tr>
    </thead>
    <tbody>
    @foreach (var player in ViewBag.Players) {
        <tr>
            <td class="playerName">
                @(Html.ActionLink((string)player.Name, "Player", "Team", new { id = player.Id }, null))
            </td>
            @foreach (var stat in player.GetCompletePlayerStats(ViewBag.Stats)) {
                <td>
                    @{var level = stat.GetLevel();}
                    @{var title = string.Format("level {0}: {1}", level, LaxCraftSession.LevelTitles[level]);}
                    @{var src = Url.Content("~/content/images/" + level + ".png");}
                    <img src="@src" alt="@title" title="@title" />
                </td>
            }
        </tr>
    }
    </tbody>
</table>


<script type="text/javascript">
    $(document).ready(function () {
        $("#teamTable").tablesorter();
        $(".abbreviation").tooltip();
    }
); 
</script>